package com.demo;

public class Item {
    //private 子类不能访问
    //private String title;

    //protected 同一个包下面的子类可以访问

    private String title;
    private int playingTime;
    private boolean gotIt=false;
    private String comment;

    //父类构造器先初始化执行
    public Item() {
        System.out.println("初始化执行没有参数的构造器 super();");
    }

    public Item(String title, int playingTime, boolean gotIt, String comment) {
        this.title = title;
        this.playingTime = playingTime;
        this.gotIt = gotIt;
        this.comment = comment;
//        System.out.println("初始化执行有参数的构造器 super(title);");

    }

    public void print() {
        System.out.print("title:"+title);
    }

}
